<#-- sql文件生成模板 -->
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${namespace}">
	
    <resultMap id="BaseResultMap" type="${basePackage}${r"."}entity${r"."}${entityName}">
    <#list mapperRelations as mapperRelation>
    <#if primaryKey ==mapperRelation.column>
      <id column="${mapperRelation.column}" property="${mapperRelation.property}"/>
    <#else>
      <result column="${mapperRelation.column}" property="${mapperRelation.property}"/>
    </#if>
    </#list>
    </resultMap>

    <sql id="Base_Column_List">
      <#list mapperRelations as mapperRelation>${mapperRelation.column} AS "${mapperRelation.property}"<#if mapperRelation_has_next>${","}</#if></#list>
    </sql>

    <select id="customPageList" resultType="${selectPage.parameterType}" parameterType="${selectPage.parameterType}">
      SELECT
        <include refid="Base_Column_List"/>
      FROM ${tableName}
      WHERE 1=1
      <#list selectPage.conditions as contiditon>
        AND ${contiditon.column} =${r"#"}{${contiditon.property}}
      </#list>
    </select>

</mapper>